<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$json = file_get_contents('php://input');

require_once "db.class.php";
require_once "config.inc.php";

$DB = new db();
if ($DB)
    $DB->connect(TT_DBHOST, TT_DBUSER, TT_DBPW, TT_DBNAME, TT_DBCHARSET, TT_DBCONNECT, TT_DBTABLEPRE);
else
    exit("cann't init database");
$pid = $_GET['pid'];
echo $pid;
$query = sprintf("update ".TT_DBTABLEPRE."pic set marks = '%s' where id = '%s'",
        base64_encode($json), $pid);
$DB->result_first($query);
$uid = $DB->insert_id();

?> 
